import request from '@/static/js/popular.js'

/**
 * 送修
 */
const repair = {
	common: {
		/**
		 * 获取详情
		 */
		getDetail: (repairId) => request.ajaxPost('/wechat/repairInfo/repairInfo', {
			repairId
		}),
		/**
		 * 暂停
		 */
		pause: (repairId) => request.ajaxPost('/busRepairInfo/suspend', {
			repairId
		}),

	},
	/**
	 * 厂家
	 */
	factory: {
		initListName: '/wechat/repairInfo/manufacturerPage',
		initList: (params = {}) => request.ajaxPost('wechat/repairInfo/manufacturerPage', params),
		/**
		 * 提交报价
		 */
		submitQuote: (params = {}) => request.ajaxPost('/wechat/manufacturer/manufacturerQuote', params),
		/**
		 * 放弃报价
		 */
		cancelQuote: (params = {}) => request.ajaxPost('/wechat/manufacturer/cancelQuote', params),
		/**
		 * 设备取走
		 */
		devicePickUp: (params = {}) => request.ajaxPost('/repairTakeAway/takeWay', params),
		/**
		 * 确认设备无法维修   
		 */
		confirmDeviceRepair: (params = {}) => request.ajaxPost('/busRepairReturnWeChat/unableRepair', params),
		/**
		 * 确认送达
		 */
		confirmService: (params = {}) => request.ajaxPost('/busRepairReturnWeChat/currencySend', params),
		/**
		 * 工程师确认送达
		 */
		confirmEngineerService: (params = {}) => request.ajaxPost('/wechat/takeAway/engineerService', params),
		/**
		 * 红点数据
		 */
		initRedNumData: (params = {}) => request.ajaxPost('/wechat/repairInfo/manufacturerPageRed', params),
		/**
		 * 维修结算
		 */
		confirmSettlement: (params = {}) => request.ajaxPost('/busRepairReturnWeChat/settlement', params)
	},
	department: {
		initListName: '/wechat/repairInfo/hospitalRepairInfo',
		initList: (params = {}) => request.ajaxPost('wechat/repairInfo/hospitalRepairInfo', params),
		/**
		 * 提交送修 新增送修
		 */
		submitSendRepair: (params = {}) => request.ajaxPost('/busRepairInfo/saveRepair', params),
		/**
		 * 确认取走
		 */
		comfirmPickUp: (params = {}) => request.ajaxPost('/wechat/takeAway/engineerTakeAway', params),
		/**
		 * 确认送达
		 */
		confirmService: (params = {}) => request.ajaxPost('/busRepairReturnWeChat/currencySend', params),
		/**
		 * 报价审核确认
		 */
		confirmQuoteReview: (params = {}) => request.ajaxPost('/repairManufacturer/quoteConfirm', params),
		/**
		 * 确认完成维修
		 */
		confirmCompleteRepair: (params = {}) => request.ajaxPost('/busRepairReturnWeChat/completeRepair', params),
		/**
		 * 红点数据
		 */
		initRedNumData: (params = {}) => request.ajaxPost('/wechat/repairInfo/hospitalRepairInfoCount', {}),
		/**
		 * 查询某个设备的数据
		 * 
		 */
		getDeviceData: (code) => request.ajaxPost('/bus/assets/getAssertByCode', { assetCode: code })
	}
}
export default repair
